package com.xuecheng.auth.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Component;

/**
 * @ Author：祝文龙
 * @ Date：2023-11-28-20:29
 * @ Version：1.0
 * @ Description：重写原来的DaoAuthenticationProvider,因为我们要重写校验密码的方法,因为我们统一认证入口,有一些认证方式不需要校验密码.
 */
@Component
public class DaoAuthenticationProviderCustom  extends DaoAuthenticationProvider {

    public void setUserDetailsService(UserDetailsService userDetailsService) {
        super.setUserDetailsService(userDetailsService);
    }
    @Override
    protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException {

    }
}
